<?php
/*
* Description: Create taxonomy in property custom post type
* Version: 1.0
* Author: huuducvt
* Author URI: http://zonthemes.com/author/huuducvt
*/

add_action( 'init', 'zonthemes_property_taxonomy', 0 );

function zonthemes_property_taxonomy() {
	//add taxonumy Property type
	$labels = array(
		'name'              => _x( 'Property type', 'taxonomy general name' ),
		'singular_name'     => _x( 'Property type', 'taxonomy singular name' ),
		'search_items'      => __( 'Search Property type' ),
		'all_items'         => __( 'All Property type' ),
		'parent_item'       => __( 'Parent Property type' ),
		'parent_item_colon' => __( 'Parent Property type:' ),
		'edit_item'         => __( 'Edit Property type' ),
		'update_item'       => __( 'Update Property type' ),
		'add_new_item'      => __( 'Add New Property type' ),
		'new_item_name'     => __( 'New Property type Name' ),
		'menu_name'         => __( 'Property type' ),
	);

	$args = array(
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'query_var'         => true,
		'rewrite'           => array( 'slug' => 'property-type' ),
	);

	register_taxonomy( 'property-type', array( 'property' ), $args );
	
	//add taxonomy location
	$labels = array(
		'name'              => _x( 'Location', 'taxonomy general name' ),
		'singular_name'     => _x( 'Location', 'taxonomy singular name' ),
		'search_items'      => __( 'Search Location' ),
		'all_items'         => __( 'All Location' ),
		'parent_item'       => __( 'Parent Location' ),
		'parent_item_colon' => __( 'Parent Location:' ),
		'edit_item'         => __( 'Edit Location' ),
		'update_item'       => __( 'Update Location' ),
		'add_new_item'      => __( 'Add New Location' ),
		'new_item_name'     => __( 'New Location Name' ),
		'menu_name'         => __( 'Location' ),
	);

	$args = array(
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'query_var'         => true,
		'rewrite'           => array( 'slug' => 'location' ),
	);

	register_taxonomy( 'location', array( 'property' ), $args );
	
	//add taxonomy Properties
	$labels = array(
		'name'              => _x( 'Properties', 'taxonomy general name' ),
		'singular_name'     => _x( 'Properties', 'taxonomy singular name' ),
		'search_items'      => __( 'Search Properties' ),
		'all_items'         => __( 'All Properties' ),
		'parent_item'       => __( 'Parent Properties' ),
		'parent_item_colon' => __( 'Parent Properties:' ),
		'edit_item'         => __( 'Edit Properties' ),
		'update_item'       => __( 'Update Properties' ),
		'add_new_item'      => __( 'Add New Properties' ),
		'new_item_name'     => __( 'New Properties Name' ),
		'menu_name'         => __( 'Properties' ),
	);

	$args = array(
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'query_var'         => true,
		'rewrite'           => array( 'slug' => 'properties' ),
	);

	register_taxonomy( 'properties', array( 'property' ), $args );
	
	//add taxonomy Suburb
	$labels = array(
		'name'              => _x( 'Suburb', 'taxonomy general name' ),
		'singular_name'     => _x( 'Suburb', 'taxonomy singular name' ),
		'search_items'      => __( 'Search Suburb' ),
		'all_items'         => __( 'All Suburb' ),
		'parent_item'       => __( 'Parent Suburb' ),
		'parent_item_colon' => __( 'Parent Suburb:' ),
		'edit_item'         => __( 'Edit Suburb' ),
		'update_item'       => __( 'Update Suburb' ),
		'add_new_item'      => __( 'Add New Suburb' ),
		'new_item_name'     => __( 'New Suburb Name' ),
		'menu_name'         => __( 'Suburb' ),
	);

	$args = array(
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'query_var'         => true,
		'rewrite'           => array( 'slug' => 'suburb' ),
	);

	register_taxonomy( 'suburb', array( 'property' ), $args );

	//add taxonomy Features
	$features = array(
		'name'              => _x( 'Features', 'taxonomy general name' ),
		'singular_name'     => _x( 'Features', 'taxonomy singular name' ),
		'search_items'      => __( 'Search Features' ),
		'all_items'         => __( 'All Features' ),
		'parent_item'       => __( 'Parent Features' ),
		'parent_item_colon' => __( 'Parent Features:' ),
		'edit_item'         => __( 'Edit Features' ),
		'update_item'       => __( 'Update Features' ),
		'add_new_item'      => __( 'Add New Features' ),
		'new_item_name'     => __( 'New Features Name' ),
		'menu_name'         => __( 'Features' ),
	);

	$args = array(
		'hierarchical'      => true,
		'labels'            => $features,
		'show_ui'           => true,
		'show_admin_column' => true,
		'query_var'         => true,
		'rewrite'           => array( 'slug' => 'features' ),
	);

	register_taxonomy( 'features', array( 'property' ), $args );
	
}
?>